package com.syq.face.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.syq.face.entity.Role;

public class LoginInfo  {
    Role role;
    String token;

    public LoginInfo() {

    }

    /**
     * 序列化
     * @param in
     */
    protected LoginInfo(Parcel in) {
        token = in.readString();
        // 读取对象需要提供一个类加载器去读取,因为写入的时候写入了类的相关信息
        role=in.readParcelable(Role.class.getClassLoader());

    }


    @Override
    public String toString() {
        return "LoginInfo{" +
                "role=" + role +
                ", token='" + token + '\'' +
                '}';
    }

    public LoginInfo(Role role, String token) {
        this.role = role;
        this.token = token;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }


}
